<!DOCTYPE html>
<html>
<head>
<style> 
div {
  width:  50px;
  height: 50px;
  background-color: red;
  position:relative;
  /* animation-name: example;
  animation-duration: 4s; */
  animation:example 5s infinite; 
}

@keyframes example {
  from {
    background-color: red;
    top: 20px;
    width: 50px;
    height: 50px;
  }
  to {
    background-color: yellow;
    top: 300px;
    width:  400px;
    height: 400px;
  }
}
</style>
</head>
<body>

<p><b>注释：</b>本例在 Internet Explorer 9 以及更早的版本中无效。</p>

<div></div>

<p><b>注释：</b>当动画结束后，会变回最初的样式。</p>

</body>
</html>
